<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>

    <meta charset="UTF-8">
    <title>物资入库</title>
    <script th:src="@{/js/jquery.min.js}"></script>
    <style>
        .greenStyle {
            background: lightgreen;
        }
    </style>
    <script>

        function entertext() {
            document.getElementById("trayCode").focus()
        }

        function saveInJob() {
            var trayCode = document.getElementById("trayCode").value;
            var quantity = document.getElementById("quantity").value;


            if (trayCode == "") {
                alert("托盘条码为空");
                return
            }
            $.ajax({
                "url": "/pda/jobTpAdd1?trayCode=" + trayCode + "&quantity=" + quantity,
                "type": "POST",
                "dataType": "json",
                "success": function (result) {
                    alert(result.msg)
                    $('#quantity').val("");
                    $('#trayCode').val("");


                }
            });
        }


    </script>
</head>
<body>
<table id="tbb" width="98%" border="1" align="center" cellPadding="0" cellSpacing="0">

    <tr>
        <td align="right">托盘条码：
        </td>
        <td>
            <input type="text" id="trayCode" name="trayCode" style="width:100%;color: #0d8ddb" oninput="entertext1()">
        </td>
    </tr>

    <tr>
        <td align="right">数量:</td>
        <td><input id="quantitr" type="text" name="quantity" style="width: 100%"value = "6"/>
        </td>

    </tr>
    <tr>
        <td width="60%" align="center">

            <button id="btn_submit2" type="button" onclick="saveInJob()" style="width:30%;"> 提交信息</button>
        </td>
    </tr>
</table>
</body>
</html>